#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
struct CODE {
    int x;
    int y;
};
int main() {
    int n;
    cin >> n;
    int sum1 = 0, sum2 = 0;
    CODE code[100];
    for (int i = 0; i < n; i++) {
        cin >> code[i].x >> code[i].y;
    }
    for (int i = 0; i < n; i++) {
        sum1 += code[i].x;
        sum2 += code[i].y;
    }
    cout << sum1 << " " << sum2;
    return 0;
}
